package com.lujieni.threadpool.context;

import com.alibaba.ttl.TransmittableThreadLocal;
import com.lujieni.threadpool.po.User;

/**
 * @Author：小鹿爱吃鱼
 * @Date: 2025/2/25 19:33
 * @Description:
 */
public class UserHolder {

    private static final ThreadLocal<User> userHolder = new TransmittableThreadLocal<>();


    public static User getUser(){
        return userHolder.get();
    }

    public static void setUser(User user){
        userHolder.set(user);
    }

    public static void removeUser(){
        userHolder.remove();
    }

}
